<template>
  <div>
    <el-form ref="searchForm" :model="searchForm" inline>
      <el-form-item label="单据类型">
        <el-select v-model="searchForm.lngreceipttypeid" placeholder="请选择" clearable>
          <el-option
            v-for="item in receipttypeList"
            :key="item.lngreceipttypeid"
            :label="item.strreceipttypename"
            :value="item.lngreceipttypeid"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { receipttypeList } from '@/api/system/bill-setting/bill-number-rules/index'
export default {
  name: 'BillNumberRulesSearch',
  data() {
    return {
      searchForm: {
        lngreceipttypeid: ''
      },
      receipttypeList: []// 单据类型下拉
    }
  },
  created() {
    this.getReceipttypeList()
  },
  mounted() {
    this.search()
  },
  methods: {
    search() {
      this.$emit('search', this.searchForm)
    },
    // 单据类型
    getReceipttypeList() {
      receipttypeList().then(res => {
        if (res.code === 20000) {
          this.receipttypeList = res.data
          this.$emit('receipttypeList', res.data)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
